UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iPj02vQA6Bg7TLBa9hIEnuZJlXFZmUtwo7FaTSEsG+A=' 
WHERE 
  key_id = '4cd572b7c38fa26ffdadb5b7780011cdba3d81d9f48ddd063c2ee1959c3f5efc' 
  AND (
    token = 'iPj02vQA6Bg7TLBa9hIEnuZJlXFZmUtwo7FaTSEsG+A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026