UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3TFMHMvRJZDnKgbomlT7KphXDi5iK+UoWiKL59bPOos='
WHERE
key_id = 'fc8136cc512755bf9781b0520cb71e666c3ef8b030e9b70cbc0128f950798a35'
AND (
token = '3TFMHMvRJZDnKgbomlT7KphXDi5iK+UoWiKL59bPOos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)