UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gl3giwjwQf/DOPjc5YYwMUEHQZXao+G1la4u4gSQ0WM='
WHERE
key_id = 'd3b157ad4b0633fe2b2e7893a546a77b8ffe26757e7537deb7a221ceb13324e1'
AND (
token = 'Gl3giwjwQf/DOPjc5YYwMUEHQZXao+G1la4u4gSQ0WM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)