UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tBtl/CqwVyPbnmLhkQvdG9TOKjnXz6K5HYWGevoE+cI=' 
WHERE 
  key_id = '8373e65058694dea7fd997013e3f74da3bb920e5c278806384b5244224a399ce' 
  AND (
    token = 'tBtl/CqwVyPbnmLhkQvdG9TOKjnXz6K5HYWGevoE+cI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051