UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/WvesMx3OGyM/ZBeQw0Gh1hxvsc+xQoXMn1q3jf520w='
WHERE
key_id = 'e453e5748076394d2e777489f7c0d76c854cddc057043e2687cebdbeb2dd2e3c'
AND (
token = '/WvesMx3OGyM/ZBeQw0Gh1hxvsc+xQoXMn1q3jf520w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)