UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qD+mPHDPNu0Xv4TRGQ5PS/PBoQZw+0AbHUUDpVGc0XM='
WHERE
key_id = '39895a441d053dd8d13ed7892df286951f3e78b4c5759c23b60f498f1f49963a'
AND (
token = 'qD+mPHDPNu0Xv4TRGQ5PS/PBoQZw+0AbHUUDpVGc0XM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)