UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JCjWkyuiN0m1ic4YleQ6piqAT7cSTCJCWqlfafnSqys=' 
WHERE 
  key_id = '3056d5630229f289bb1effde26356f0122de0d39fd403e932b7e8c0eaa29a734' 
  AND (
    token = 'JCjWkyuiN0m1ic4YleQ6piqAT7cSTCJCWqlfafnSqys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021