UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '34XURymcg2poxs0IU+NfrJhvo6AHfL/GLnbVSB148L4=' 
WHERE 
  key_id = 'c52f555e4617bf0e6f1ea2d4589d04a36aa45f5535723aaf87840d9d24172b5a' 
  AND (
    token = '34XURymcg2poxs0IU+NfrJhvo6AHfL/GLnbVSB148L4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014