UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pf62oyHjxkSswbuGFlbXBCsCEaolASUwFbek9c8Nrrk=' 
WHERE 
  key_id = 'ebd19b08843c9964affc441cb2cdbc1b09ebbdd0560c5263dcf7bd80e06be2f3' 
  AND (
    token = 'pf62oyHjxkSswbuGFlbXBCsCEaolASUwFbek9c8Nrrk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046