UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JGuDuuL+9N6EgoAs2Maxa7xJXN8dS8dxcQrjfGO/osU='
WHERE
key_id = '7e58a5ba607bb8498fe86348d1dec4fbcbfe91a05e9adefafd83d5426daf800b'
AND (
token = 'JGuDuuL+9N6EgoAs2Maxa7xJXN8dS8dxcQrjfGO/osU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)