UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6o5i7kJEmzvxOb+uhtuhfei7d04mbSbrZ64m4lae6VE=' 
WHERE 
  key_id = 'c339448a5dbdfd1a0bf3966abe451a5554acf8a7c34028a2f5e33f4959afed6e' 
  AND (
    token = '6o5i7kJEmzvxOb+uhtuhfei7d04mbSbrZ64m4lae6VE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025