UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vOLJ6i23gGlmynWb83R4p4yyRiDL0WQH0c6bqHTLSUE='
WHERE
key_id = 'a9a51bde2f36e9ac4c2fc37dc49efc3b10d2d11962a8c2c8ddd3d4e0688cc25b'
AND (
token = 'vOLJ6i23gGlmynWb83R4p4yyRiDL0WQH0c6bqHTLSUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)