UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SzVb3mHt/pnRpd0U/WaCWnyAnpY4rZoxfhW7htaHRfk='
WHERE
key_id = 'c0f3e9ba8193a7cf73d93bfd65d4ea586d515f15bda043423d4b67f36485c31d'
AND (
token = 'SzVb3mHt/pnRpd0U/WaCWnyAnpY4rZoxfhW7htaHRfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)