UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jsa315ikgjX2Hg2Ks7mlhsA1c2U/ekshhINdzrLJrro='
WHERE
key_id = 'b2f1547dc6b4fa00d2a78c4186ca4db9634a2534500bde24df64edb40b5afb5a'
AND (
token = 'jsa315ikgjX2Hg2Ks7mlhsA1c2U/ekshhINdzrLJrro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)