UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zY5WUsMJlL+78Zk6GMF+0Y8uzRKWQyKc0N1uhnYXhjo=' 
WHERE 
  key_id = '1d1046e16d30819996861e8063a622fcf3326ad5fe9a3b09580c3248ad6ce0fd' 
  AND (
    token = 'zY5WUsMJlL+78Zk6GMF+0Y8uzRKWQyKc0N1uhnYXhjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029