UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fvvsUSRmPViQ+4OmXtMVX40ijOk/iuUa+SCjp2jPxXk=' 
WHERE 
  key_id = 'db900ec74c33bd64e7057862f4ea4c87b7494a0ad10c38a5e057819f2921e2a9' 
  AND (
    token = 'fvvsUSRmPViQ+4OmXtMVX40ijOk/iuUa+SCjp2jPxXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025