UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v/y4ZjObajeuH1As1TisK5P6HFqfOwqe/zWFqZRjQCM='
WHERE
key_id = '1b25107f2a38e77268a0fcbcf72a1c93dcbfb947cfc91fb29a93eac4c77c0729'
AND (
token = 'v/y4ZjObajeuH1As1TisK5P6HFqfOwqe/zWFqZRjQCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)