UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RkIri8ZSFz5iq932loj7OAfd9ezo4GjhKM5/ozfYvuw=' 
WHERE 
  key_id = 'bd9f620522fb8e74c1ff1b596356a325d78284785ee587bffa87dfb524417d15' 
  AND (
    token = 'RkIri8ZSFz5iq932loj7OAfd9ezo4GjhKM5/ozfYvuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023