UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mM3dAiGX9g/0qoczgSkOESAUvLF6UjviYpib1WxFNts='
WHERE
key_id = '00f9ead31ce091ba3048a01b9174342ff0c5173b07d3733b38aabe9bafc10496'
AND (
token = 'mM3dAiGX9g/0qoczgSkOESAUvLF6UjviYpib1WxFNts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)