UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tWAORSJxjogxC4YXa7yTDE5gzYnK/fAHbR0Pj1DbKT0='
WHERE
key_id = '7507dd7c580ff7646baac0416306d97f98964ec1fc8f4e076624c6bee6beb0e8'
AND (
token = 'tWAORSJxjogxC4YXa7yTDE5gzYnK/fAHbR0Pj1DbKT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)