UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vhQReD1e6QnxkUQW5veE5co63td6HmTfNOgD5Jj14og='
WHERE
key_id = '9f9c4c6f7dab101bd504c32b6ab49b3f3545551a7a1d63b12a3d28001f19b3de'
AND (
token = 'vhQReD1e6QnxkUQW5veE5co63td6HmTfNOgD5Jj14og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)