UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm9xOZx0Hj/a7yUECgWDDq7/oP2/A7D5NayP37RC6E7Q=' 
WHERE 
  key_id = '96c1ca7d253ea8c8e86ae2225c778474dabe4c0882efacc878bc6bb391af9d1b' 
  AND (
    token = 'm9xOZx0Hj/a7yUECgWDDq7/oP2/A7D5NayP37RC6E7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034