UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cCGLMPTxS8Hd8nz21OnCyTkH3Udf8B3JHslusLLVsq0='
WHERE
key_id = '936d577f07867af5b664c61a9dc2fe0dfe64416e575d80e2d516d328fe1d5840'
AND (
token = 'cCGLMPTxS8Hd8nz21OnCyTkH3Udf8B3JHslusLLVsq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)