UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YUH67h7u0FRU51IzIQQYBjx4q9U1hq0Ks7rv2WCpup4=' 
WHERE 
  key_id = '0036e8be5eb372254fb5318acf1c73e357ec1702976a249080bd4e50cc25c276' 
  AND (
    token = 'YUH67h7u0FRU51IzIQQYBjx4q9U1hq0Ks7rv2WCpup4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040