UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RUDU7rxf6d8mmrsu+F1d36/Y6R6CVnc3IPKelKfJj1U='
WHERE
key_id = 'dd58cd57fa74a02cfbc8af87ca6da5df7e2bfa3ac25338e4fd2a615b5d2d1cb6'
AND (
token = 'RUDU7rxf6d8mmrsu+F1d36/Y6R6CVnc3IPKelKfJj1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)