UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Ttx2fnMPuJ+WnLyagQReYjBfquf08x5BmjAa1XAeMw='
WHERE
key_id = '4f2c38dc4e3a213d689afeb206adff70a80c248f685f809bcf631e0364b3c36b'
AND (
token = '6Ttx2fnMPuJ+WnLyagQReYjBfquf08x5BmjAa1XAeMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)