UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4gh/dgg0C/I9gfOkNIQCvCuOwuNHIFW9L67xQmEbjA='
WHERE
key_id = '17c6c3053e85030eda68c0fe0ca24c20fa4bf9fd4a4d1ec0e3ebb5123f1d0a7c'
AND (
token = '+4gh/dgg0C/I9gfOkNIQCvCuOwuNHIFW9L67xQmEbjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)