UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kk+d+S4icVP3Mzn9sVpm9xOk1CEjVMU+/QhrSjEDZ2s='
WHERE
key_id = '5064e2504f62c69d71c2af460e1ddd61b255da1a8b38cb57121cf374acbdcef2'
AND (
token = 'kk+d+S4icVP3Mzn9sVpm9xOk1CEjVMU+/QhrSjEDZ2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)