UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nvm0Ej211TBIV4eL3AMk5HS2607RwfTv762H+MBrvyg='
WHERE
key_id = '2abb7418c4fe0dc88934e2214687e2f431a80922ff5b51ad3f1414aa86a538af'
AND (
token = 'Nvm0Ej211TBIV4eL3AMk5HS2607RwfTv762H+MBrvyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)