UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4QFKA4TvL7HtIOYf8IKTLwwO/FO4wee3l8UkjMHNm+w='
WHERE
key_id = '11db7c617c8ef04495e9b0d7ff752664c4252e489dafb10a53ee1b5829b71804'
AND (
token = '4QFKA4TvL7HtIOYf8IKTLwwO/FO4wee3l8UkjMHNm+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)