UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9u8OEsu8qleLoHhNw77SDWL1aHllMIo6EGuM7BqiUpw=' 
WHERE 
  key_id = '97036060e1fea41d52630effc5240c157db378af0e0f77900264a784ef84ce67' 
  AND (
    token = '9u8OEsu8qleLoHhNw77SDWL1aHllMIo6EGuM7BqiUpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040