UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ErovuEYNRuK7gyNlaGGrq5VZ3maUcwA31GR6i1/wNc='
WHERE
key_id = '4325417326807bd08281c16c86d68406f4cf0bbef89e48277cb31326f2db4eb6'
AND (
token = '1ErovuEYNRuK7gyNlaGGrq5VZ3maUcwA31GR6i1/wNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)