UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HwbhB0v+PUJ2x6kXhiFNgIhwfOLDQRSU5xjVMICz/Mo=' 
WHERE 
  key_id = '47202f9dc11af7841b318641c41b4c1914754ef16c557e86c921df59df330d67' 
  AND (
    token = 'HwbhB0v+PUJ2x6kXhiFNgIhwfOLDQRSU5xjVMICz/Mo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016