UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UOfEZjPQH00cL1nT/lPdxXNiRkyBek982D4JxntLaJk='
WHERE
key_id = 'c320a538037c113331f7fecf773feaa4a0c04de181f7fa7393486ef77653f270'
AND (
token = 'UOfEZjPQH00cL1nT/lPdxXNiRkyBek982D4JxntLaJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)