UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IkgeSpj7lJgKxe4qUiIa6Ehp8ZnE/cCABl+mSYbWVaQ='
WHERE
key_id = '81268974a67f5f4aef540822751214b65cfa00bd995d18ef37193e33f7d5b35c'
AND (
token = 'IkgeSpj7lJgKxe4qUiIa6Ehp8ZnE/cCABl+mSYbWVaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)