UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uif+Uk0DeMdimJKQhFPPj0FwGjnQubuVCBQvQs+4c8U=' 
WHERE 
  key_id = '0e0e8166ce3d3358dddbde1092ef76cc4920e90ebbb8ec87b99221f84534a5d7' 
  AND (
    token = 'Uif+Uk0DeMdimJKQhFPPj0FwGjnQubuVCBQvQs+4c8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024