UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RycNMfn1rpR3i56u99f3Xk3p64ky/n+SXA63jLQvbHQ=' 
WHERE 
  key_id = 'acb35ebff5a9573b08bdc2c1a69daf4103711c2c3e3fc7186e67ec7eb5ac8283' 
  AND (
    token = 'RycNMfn1rpR3i56u99f3Xk3p64ky/n+SXA63jLQvbHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037