UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4RwaUIDOG9PGh7EvOynlZbBhLo/4SE9KiVAzscUCNoM='
WHERE
key_id = 'edee11a8c96b6d4cc831c1200a9c551fca63531447c7be2f767c3fa13d5ea441'
AND (
token = '4RwaUIDOG9PGh7EvOynlZbBhLo/4SE9KiVAzscUCNoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)