UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ae8a9f5kxry/U5nc4rcjcbkwOOZOuDgBHSKA8W2+sI0='
WHERE
key_id = '544374c8085326ecbc630ebe2b008a724df503121b48970b9973092cad4a2726'
AND (
token = 'Ae8a9f5kxry/U5nc4rcjcbkwOOZOuDgBHSKA8W2+sI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)