UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6bKo4534vMQCrAZiX6WukMGoP1+ioF5NyDJHRmN5g1w='
WHERE
key_id = '28f0e9e31e3936447a687f7c81703f388f35d1595c686897a1a13e8a4d6967cb'
AND (
token = '6bKo4534vMQCrAZiX6WukMGoP1+ioF5NyDJHRmN5g1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)