UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OFEmEugpXa+0eXDQIdbT4mH7eYcakPwcG/pjOZXeemA=' 
WHERE 
  key_id = '613084edccb95e42d28292e06ec65818eba5533603a28fb117bb19b8fbeb8837' 
  AND (
    token = 'OFEmEugpXa+0eXDQIdbT4mH7eYcakPwcG/pjOZXeemA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021