UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's5D9TQ8aIPdXQUhxGpfn4M8GMeuZn5V1M/LJz3Pi7Us='
WHERE
key_id = 'b6a0ea96f97f7497b583376b5f2e1da621ee5ba390d816efed6628eae3a624aa'
AND (
token = 's5D9TQ8aIPdXQUhxGpfn4M8GMeuZn5V1M/LJz3Pi7Us='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)