UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B1BXyoOL63L/+mLSR6zzg/nuQBEHCZ05YT8+GrFFgnE='
WHERE
key_id = 'e8df1e1f972243172fd21e634f5e17bdeacdcfdd0b400d2a127f7c6aef2c2281'
AND (
token = 'B1BXyoOL63L/+mLSR6zzg/nuQBEHCZ05YT8+GrFFgnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)