UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wmIpD5Eu6oB0xqbimllz8AbgR45i44kmWMmxZOPSe4U='
WHERE
key_id = '70cae85acc997cac4ccf17b37c3c1aa91655a369fe1c25f6ea54bd18118e36d5'
AND (
token = 'wmIpD5Eu6oB0xqbimllz8AbgR45i44kmWMmxZOPSe4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)