UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MBz7I/IwxRGxlYEGT3V1YJUmp77FqIDcRV5jMtoD4X4='
WHERE
key_id = '4c2edde5b90765e86c0d0e1671ee731d759baf183f0b22a48d29b0feb1e3d89c'
AND (
token = 'MBz7I/IwxRGxlYEGT3V1YJUmp77FqIDcRV5jMtoD4X4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)