UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DNtPVF/bKdVEE026cogNN+PxCtvq/cndO4gQ2Wf/VmY=' 
WHERE 
  key_id = '8225c1dad5eaa4dfcc3d99ccf29a2f0bc7d824037d6259153b0022c5bcdb958c' 
  AND (
    token = 'DNtPVF/bKdVEE026cogNN+PxCtvq/cndO4gQ2Wf/VmY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032