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

Query time 0.00025