UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JkVC9mywpLzyBgQA8MesvCbjXBM/oKCC47mTKSEfk8c=' 
WHERE 
  key_id = '2534d8cae8e6cca53bb066bb39be6c8124ff0ed9cd02536ed6e9dae10fc56886' 
  AND (
    token = 'JkVC9mywpLzyBgQA8MesvCbjXBM/oKCC47mTKSEfk8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053