UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'afwLaTvRatQxsWuN7BRLyx/fy3u2ANE3jRGjZnx9bk4=' 
WHERE 
  key_id = '86e99e64987f2a5f1093edbc2ff636c9c28681b6e458838ef7312a76c1b6722a' 
  AND (
    token = 'afwLaTvRatQxsWuN7BRLyx/fy3u2ANE3jRGjZnx9bk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043