UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd4FCKkK7WZltW6PkOH8OZi+f2F55b1AtS/HQb3ABu50=' 
WHERE 
  key_id = '20bb212403a26932e46b58c92fe92c20e111378bd6619820f523aa179782c796' 
  AND (
    token = 'd4FCKkK7WZltW6PkOH8OZi+f2F55b1AtS/HQb3ABu50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034