UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tixwHH0DQvpll3zaGUPvWFDGwJ1O48hNn4P93BJqsaA='
WHERE
key_id = '0193265f543e02dbf344c63e2aa1049e0b7873d4cbe7b9afeef24de02071b1df'
AND (
token = 'tixwHH0DQvpll3zaGUPvWFDGwJ1O48hNn4P93BJqsaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)